# 基于这个构建一个名字叫 ubuntu_nginx_and_node 的镜像
# 指定其来源为 Ubuntu 22.04
FROM ubuntu:22.04
# 设置环境变量
ENV DEBIAN_FRONTEND=noninteractive
# 替换为清华大学的镜像源
RUN sed -i 's#http://archive.ubuntu.com/#http://mirrors.tuna.tsinghua.edu.cn/#' /etc/apt/sources.list && \
    echo 'deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse' >> /etc/apt/sources.list && \
    echo '# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy main restricted universe multiverse' >> /etc/apt/sources.list && \
    echo 'deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse' >> /etc/apt/sources.list && \
    echo '# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-updates main restricted universe multiverse' >> /etc/apt/sources.list && \
    echo 'deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse' >> /etc/apt/sources.list && \
    echo '# deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ jammy-backports main restricted universe multiverse' >> /etc/apt/sources.list
# 
RUN apt-get update --fix-missing && apt-get install -y vim --fix-missing
#
RUN apt-get install -y wget apt-transport-https
# 
RUN apt-get install -y curl
# 
RUN apt-get install -y sudo
RUN apt-get update --fix-missing
RUN apt-get install nginx -y --fix-missing
# RUN apt-get install systemd -y --fix-missing
RUN apt-get install -y screen  --fix-missing
RUN wget "https://nodejs.org/download/release/v20.11.1/node-v20.11.1-linux-x64.tar.xz"
RUN sudo apt-get install -y xz-utils
RUN sudo tar --strip-components=1 -xJf node-v20.11.1-linux-x64.tar.xz -C /usr/local